from flask import Blueprint, jsonify, render_template
from apps.modules.admin.models.cms.cms_post import Post
from flask_login import login_required, current_user
# 创建蓝图
example_bp = Blueprint('example',
                       __name__,
                       template_folder='templates',
                        static_folder="static",
                       url_prefix='/example')

@example_bp.route('/')
def index():
    post = Post.query.filter(Post.id == 16).first()
    user  = current_user

    """示例路由"""
    return render_template('example.html',post=post,user=user)

@example_bp.route('/test')
def test():
    post = Post.query.filter(Post.id == 16).first()
    user  = current_user

    """示例路由"""
    return render_template('example.html',post=post,user=user)


@example_bp.route('/demo')
def demo():
    post = Post.query.filter(Post.id == 16).first()
    user  = current_user

    """示例路由"""
    return render_template('example.html',post=post,user=user)